package guda.mrpc.core.config;


import guda.mrpc.core.serialize.ObjectSerialize;

public class ServerConfig {

    private String host;
    private int port;
    private String appId = "default";

    private ObjectSerialize objectSerialize;

    private int backlog;
    private boolean keepalive;

    private int lowWaterMark = 32 * 1024;
    private int highWaterMark = 64 * 1024;

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }

    public ObjectSerialize getObjectSerialize() {
        return objectSerialize;
    }

    public void setObjectSerialize(ObjectSerialize objectSerialize) {
        this.objectSerialize = objectSerialize;
    }

    public int getBacklog() {
        return backlog;
    }

    public void setBacklog(int backlog) {
        this.backlog = backlog;
    }

    public boolean isKeepalive() {
        return keepalive;
    }

    public void setKeepalive(boolean keepalive) {
        this.keepalive = keepalive;
    }

    public int getLowWaterMark() {
        return lowWaterMark;
    }

    public void setLowWaterMark(int lowWaterMark) {
        this.lowWaterMark = lowWaterMark;
    }

    public int getHighWaterMark() {
        return highWaterMark;
    }

    public void setHighWaterMark(int highWaterMark) {
        this.highWaterMark = highWaterMark;
    }

    public String getServerAddr(){
        return host+":"+String.valueOf(port);
    }
}
